<template>
  <div class="news-item">
    <router-link :to="`/detail/${data.id}`">
      <div class="img-box">
        <img v-if="data.images && data.images.length > 0"  v-lazy="data.images[0]" alt="" />
      </div>
      <h4 class="title">{{data.title}}</h4>
      <p class="desc">{{data.hint}}</p>
    </router-link>
  </div>
</template>

<script>
export default {
    props:{
        data:{
            type:Object,
            required:true,
        }
    }
};
</script>

<style lang="less" scoped>
.news-item {
    box-sizing: border-box;
  position: relative;
  padding: 15px 0;
  height: 95px;
  overflow: hidden;
  box-sizing: border-box;

  a {
    display: block;
  }
  .img-box {
    position: absolute;
    right: 0;
    top: 0;
    width: 65px;
    height: 65px;
    background: #d5d5d5;
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .title {
    margin-right: 75px;
    max-height: 50px;
    line-height: 25px;
    font-size: 16px;
    overflow: hidden;
    color: black;
  }

  .desc {
    margin-right: 75px;
    line-height: 15px;
    font-size: 13px;
    color: #555;
  }
}
</style>
